package com.swlz.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.swlz.entity.Article;
import com.swlz.entity.MallProduct;
import com.swlz.entity.MallType;
import com.swlz.service.ArticleService;
import com.swlz.service.MallProductService;
import com.swlz.service.MallTypeService;
import com.swlz.service.impl.ArticleServiceImpl;
import com.swlz.service.impl.MallProductServiceImpl;
import com.swlz.service.impl.MallTypeServiceImpl;

/**
 * Servlet implementation class PartnerServlet
 */
@WebServlet("/partner.let")
public class PartnerServlet extends HttpServlet {
	private Logger log=LoggerFactory.getLogger(this.getClass());
	private ArticleService articleService = new ArticleServiceImpl();
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		Long id=Long.valueOf(request.getParameter("name"));
		log.debug(id.toString());
		Article partner=articleService.get(id);
		request.setAttribute("partner", partner);
		request.getRequestDispatcher("user/partner.jsp").forward(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
